<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <link th:href="@{/img/favicon.ico}" type="image/x-icon" rel="icon"/>
  <link th:href="@{/public/bootstrap.min.css}" rel="stylesheet"/>
  <link th:href="@{/css/login.css}" rel="stylesheet"/>
  <title>修改密码</title>
</head>

<body class="main text-center">

<div id="particles-js"></div>

<main class="form-login">
  <div class="login-card">
    <div class="row">
      <picture>
        <img th:src="@{/img/logo.svg}" class="img-fluid mb-4 logo" alt="logo"/>
      </picture>
      <h5 class="h5 fw-normal text-light">请修改密码</h5>
    </div>

    <div class="row mt-3">
      <p th:text="${error}" class="text-danger text-center text-break" id="error-msg"></p>
    </div>

    <form method="post" th:action="@{/change_passwd}" onsubmit="changePassword(event)">
      <input type="hidden" name="authorize_id" th:value="${authorizeId}"/>

      <div class="form-floating">
        <input type="password"
               name="password"
               class="form-control border-top-radius"
               placeholder="新密码"
               id="password"
               required
        />
        <label for="password">新密码</label>
      </div>
      <div class="form-floating mb-4">
        <input type="password"
               name="repassword"
               class="form-control border-bottom-radius"
               placeholder="确认密码"
               id="repassword"
               required
        />
        <label for="repassword">确认密码</label>
      </div>

      <button type="submit" class="w-100 btn btn-lg btn-primary">修改密码</button>
    </form>
  </div>
</main>

<script type="text/javascript" th:src="@{/public/particles.min.js}"></script>
<script type="text/javascript" th:src="@{/js/particles.js}"></script>
<script type="text/javascript" th:src="@{/js/chpwd.js}"></script>
</body>
</html>
